package com.jxzn.locust.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jxzn.locust.dao.AbstractRepository;
import com.jxzn.locust.dao.ManagerRepository;
import com.jxzn.locust.model.Manager;
import com.jxzn.locust.service.ManagerService;

@Service
@Transactional
public class ManagerServiceImpl implements ManagerService {

    @Autowired
    ManagerRepository managerRepository;

    @Override
    public AbstractRepository<Manager> getRepository() {
        return managerRepository;
    }

    @Override
    public Manager findByAccount(String account) {
        return managerRepository.findByAccount(account);
    }

    @Override
    public int login(Manager manager) {
        return managerRepository.login(manager.getId());
    }

}
